src: remove whitespaces at EOL
authorÁlvaro Fernández Rojas <[email protected]>
Mon, 10 Nov 2025 12:12:46 +0000 (13:12 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Mon, 10 Nov 2025 16:46:48 +0000 (17:46 +0100)
These whitespaces do nothing and can be removed.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/config.c
src/dhcpv6.c
src/odhcpd.c
src/router.c
src/router.h

index 109376a14dcc655ddee14158320a4c7df86a04fb..39a6db530c43ceaeea76d9fd5744faac92bbbe9b 100644 (file)
@@ -1431,7 +1431,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
        if ((c = tb[IFACE_ATTR_RA_REACHABLETIME])) {
                uint32_t ra_reachabletime = blobmsg_get_u32(c);
 
-               /* RFC4861 §6.2.1 : AdvReachableTime : 
+               /* RFC4861 §6.2.1 : AdvReachableTime :
                 * MUST be no greater than 3,600,000 msec
                 */
                iface->ra_reachabletime = ra_reachabletime <= AdvReachableTime ? ra_reachabletime : AdvReachableTime;
@@ -1504,7 +1504,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
                uint32_t ra_maxinterval = blobmsg_get_u32(c);
                if (ra_maxinterval < 4)
                        ra_maxinterval = 4;
-               else if (ra_maxinterval > MaxRtrAdvInterval) 
+               else if (ra_maxinterval > MaxRtrAdvInterval)
                                ra_maxinterval = MaxRtrAdvInterval;
                iface->ra_maxinterval = ra_maxinterval;
        }
@@ -1518,12 +1518,12 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
                uint32_t ra_mininterval = blobmsg_get_u32(c);
                if (ra_mininterval < MinRtrAdvInterval)
                        ra_mininterval = MinRtrAdvInterval; // clamp min
-               else if (ra_mininterval > (0.75 * iface->ra_maxinterval)) 
+               else if (ra_mininterval > (0.75 * iface->ra_maxinterval))
                                ra_mininterval = 0.75 * iface->ra_maxinterval; // clamp max
                iface->ra_mininterval = ra_mininterval;
        }
 
-       /* 
+       /*
         * RFC4861: AdvDefaultLifetime: MUST be either zero or between MaxRtrAdvInterval and 9000 seconds.
         * RFC8319: AdvDefaultLifetime: MUST be either zero or between MaxRtrAdvInterval and 65535 seconds.
         * Default: 3 * MaxRtrAdvInterval
@@ -1532,7 +1532,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
        if ((c = tb[IFACE_ATTR_RA_LIFETIME])){
                uint32_t ra_lifetime = blobmsg_get_u32(c);
                if (ra_lifetime != 0){
-                       if (ra_lifetime < iface->ra_maxinterval) 
+                       if (ra_lifetime < iface->ra_maxinterval)
                                ra_lifetime = iface->ra_maxinterval; // clamp min
                        else if (ra_lifetime > AdvDefaultLifetime)
                                ra_lifetime = AdvDefaultLifetime; // clamp max
index cb9832e487e27a875bf0b6db5a586a9e3ed9aa44..2cbcbbc9db65c9c326219dd9262c7a70262160e8 100644 (file)
@@ -775,7 +775,7 @@ static void handle_client_request(void *addr, void *data, size_t len,
                                      iov[IOV_DHCPV6_RAW].iov_len +
                                      iov[IOV_NTP].iov_len + iov[IOV_NTP_ADDR].iov_len +
                                      iov[IOV_SNTP].iov_len + iov[IOV_SNTP_ADDR].iov_len +
-                                     iov[IOV_POSIX_TZ].iov_len + iov[IOV_POSIX_TZ_STR].iov_len + 
+                                     iov[IOV_POSIX_TZ].iov_len + iov[IOV_POSIX_TZ_STR].iov_len +
                                      iov[IOV_TZDB_TZ].iov_len + iov[IOV_TZDB_TZ_STR].iov_len +
                                      iov[IOV_DNR].iov_len + iov[IOV_BOOTFILE_URL].iov_len -
                                      (4 + opts_end - opts));
index a427dfe23e5341953f390ae2b8b3a6daef399f65..df57a49d63a4c8f1738754c01037d5bcad41aae9 100644 (file)
@@ -194,7 +194,7 @@ int main(int argc, char **argv)
 int odhcpd_get_interface_config(const char *ifname, const char *what)
 {
        char buf[64];
-       
+
        snprintf(buf, sizeof(buf), "/proc/sys/net/ipv6/conf/%s/%s", ifname, what);
 
        int fd = open(buf, O_RDONLY);
index 1903eb40272843ed9be3382cb9d3f998f77caf58..a2e95a5abc6d83eaa184891d66492c73306bb2be 100644 (file)
@@ -563,7 +563,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
        size_t dns_sz = 0, search_sz = 0, pref64_sz = 0, dnrs_sz = 0;
        size_t pfxs_cnt = 0, routes_cnt = 0;
        size_t total_addr_cnt = 0, valid_addr_cnt = 0;
-       /* 
+       /*
         * lowest_found_lifetime stores the lowest lifetime of all prefixes;
         * necessary to find longest adv interval necessary
         * for shortest lived prefix
@@ -591,11 +591,11 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
                adv.h.nd_ra_flags_reserved |= ND_RA_PREF_LOW;
        else if (iface->route_preference > 0)
                adv.h.nd_ra_flags_reserved |= ND_RA_PREF_HIGH;
+
        if (iface->dhcpv6 != MODE_DISABLED && iface->dhcpv6_pd && iface->dhcpv6_pd_preferred) {
                /* RFC9762 § 5
                 * If the network desires to delegate prefixes to devices that support
-                * DHCPv6 prefix delegation but do not support the P flag, it SHOULD 
+                * DHCPv6 prefix delegation but do not support the P flag, it SHOULD
                 * also set the M or O bits in the RA to 1
                 */
                adv.h.nd_ra_flags_reserved |= ND_RA_FLAG_MANAGED;
@@ -722,7 +722,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
                }
 
                if (preferred_lt > valid_lt) {
-                       /* 
+                       /*
                         * RFC4861 § 6.2.1
                         * This value [AdvPreferredLifetime] MUST NOT be larger than
                         * AdvValidLifetime.
@@ -746,7 +746,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
                p->nd_opt_pi_type = ND_OPT_PREFIX_INFORMATION;
                p->nd_opt_pi_len = 4;
                p->nd_opt_pi_prefix_len = (addr->prefix < 64) ? 64 : addr->prefix;
-               /* RFC9762 DHCPv6-PD Preferred Flag § 6: 
+               /* RFC9762 DHCPv6-PD Preferred Flag § 6:
                 * Routers SHOULD set the P flag to zero by default...
                 */
                p->nd_opt_pi_flags_reserved = 0;
@@ -758,7 +758,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
                        /* RFC9762 DHCPv6-PD Preferred Flag
                         * We can run both SLAAC and DHCPv6-PD.
                         * §6:
-                        * "Routers MUST allow the P flag to be configured separately from the A flag. 
+                        * "Routers MUST allow the P flag to be configured separately from the A flag.
                         * ...en/disabling the P flag MUST NOT trigger automatic changes in the A flag
                         * value set by the router."
                         */
@@ -767,7 +767,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
                        // RFC6275, §7.2
                        p->nd_opt_pi_flags_reserved |= ND_OPT_PI_FLAG_RADDR;
                if (i >= valid_addr_cnt || !preferred_lt) {
-                       /* 
+                       /*
                         * RFC9096 § 3.5
                         *
                         * - Any prefixes that were previously advertised by the CE router
index 46c6387353f3ec587f5cd189b5fba5f4c3ce3043..9b028d1a0b61c33ce7f148dbf13139e78503d9cd 100644 (file)
@@ -66,11 +66,11 @@ struct icmpv6_opt {
        define is used to cap values to a sane ceiling, i.e. ND_VALID_LIMIT.
 */
 #define RouterLifetime                                 5400
-/* RFC4861 §6.2.1 : AdvReachableTime : 
+/* RFC4861 §6.2.1 : AdvReachableTime :
  * MUST be no greater than 3,600,000 msec
  */
 #define AdvReachableTime                               3600000
-/* RFC4861 §6.2.1 : AdvCurHopLimit 
+/* RFC4861 §6.2.1 : AdvCurHopLimit
        The value should be set to the current
        diameter of the Internet.  The value zero means
        unspecified (by this router).
@@ -85,7 +85,7 @@ struct icmpv6_opt {
 #define RETRANS_TIMER_MAX                              60000
 /* RFC2460 §5
    IPv6 requires that every link in the internet have an MTU of 1280
-   octets or greater. 
+   octets or greater.
 */
 #define RA_MTU_MIN                                             1280
 #define RA_MTU_MAX                                             65535